package com.ruoyi.recipes.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recipes.mapper.RecipeCategoryTopMapper;
import com.ruoyi.recipes.domain.CategoryTop;
import com.ruoyi.recipes.service.ICategoryTopService;

import javax.annotation.Resource;

/**
 * 一级菜谱分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service("recipeCategoryTopServiceImpl")
public class CategoryTopServiceImpl implements ICategoryTopService 
{
    @Resource
    //private RecipeCategoryTopMapper categoryTopMapper;
    private RecipeCategoryTopMapper recipeCategoryTopMapper;

    /**
     * 查询一级菜谱分类
     * 
     * @param id 一级菜谱分类主键
     * @return 一级菜谱分类
     */
    @Override
    public CategoryTop selectCategoryTopById(Long id)
    {
        return recipeCategoryTopMapper.selectCategoryTopById(id);
    }

    /**
     * 查询一级菜谱分类列表
     * 
     * @param categoryTop 一级菜谱分类
     * @return 一级菜谱分类
     */
    @Override
    public List<CategoryTop> selectCategoryTopList(CategoryTop categoryTop)
    {
        return recipeCategoryTopMapper.selectCategoryTopList(categoryTop);
    }

    /**
     * 新增一级菜谱分类
     * 
     * @param categoryTop 一级菜谱分类
     * @return 结果
     */
    @Override
    public int insertCategoryTop(CategoryTop categoryTop)
    {
        return recipeCategoryTopMapper.insertCategoryTop(categoryTop);
    }

    /**
     * 修改一级菜谱分类
     * 
     * @param categoryTop 一级菜谱分类
     * @return 结果
     */
    @Override
    public int updateCategoryTop(CategoryTop categoryTop)
    {
        return recipeCategoryTopMapper.updateCategoryTop(categoryTop);
    }

    /**
     * 批量删除一级菜谱分类
     * 
     * @param ids 需要删除的一级菜谱分类主键
     * @return 结果
     */
    @Override
    public int deleteCategoryTopByIds(Long[] ids)
    {
        return recipeCategoryTopMapper.deleteCategoryTopByIds(ids);
    }

    /**
     * 删除一级菜谱分类信息
     * 
     * @param id 一级菜谱分类主键
     * @return 结果
     */
    @Override
    public int deleteCategoryTopById(Long id)
    {
        return recipeCategoryTopMapper.deleteCategoryTopById(id);
    }
}
